#include "lifter.h"
//#include "../Commands/LifterJoy.h"
#include "../CommandBase.h"
#include "../Commands/IRlocate.h"


Lifter::Lifter() : Subsystem("lifter")
{	
	lifterSpike1 = new Relay(LIFTER1, Relay::kBothDirections);
	lifterSpike2 = new Relay(LIFTER2, Relay::kBothDirections);
}
/*
void Lifter::lifterJoystick(Joystick *joystick)
{
	if(joystick->GetRawButton(BUTTON_ON))
	{
		lifterSpike1->Set(Relay::kOn);
		lifterSpike2->Set(Relay::kOn);
	}
	else if(joystick->GetRawButton(BUTTON_OFF))
	{
		lifterSpike1->Set(Relay::kOff);
		lifterSpike2->Set(Relay::kOff);
	}
	else if (joystick->GetRawButton(BUTTON_F))
	{
		lifterSpike1->Set(Relay::kForward);
		lifterSpike2->Set(Relay::kForward);
	}
	else if (joystick->GetRawButton(BUTTON_R))
	{
		lifterSpike1->Set(Relay::kReverse);
		lifterSpike2->Set(Relay::kReverse);
	}
}
*/


void Lifter::Forward()
{
	lifterSpike1->Set(Relay::kForward);
	lifterSpike2->Set(Relay::kForward);
}
void Lifter::Stop()
{
	lifterSpike1->Set(Relay::kOff);
	lifterSpike2->Set(Relay::kOff);
}
void Lifter::Reverse()
{
	lifterSpike1->Set(Relay::kReverse);
	lifterSpike2->Set(Relay::kReverse);
}

void Lifter::InitDefaultCommand()
{
	//SetDefaultCommand(new LifterJoy());
	SetDefaultCommand(new IRlocate());
}
